package cn.usian.mapper;

import cn.usian.jyzx.model.dto.h5.ProductSkuDto;
import cn.usian.jyzx.model.entity.product.Product;
import cn.usian.jyzx.model.entity.product.ProductSku;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProductMapper {
    @Select("select * from product_sku order by sale_num desc limit 10")
    List<ProductSku> findS();

    List<ProductSkuDto> productSkuDtoPageInfo( ProductSkuDto productSkuDto);

    @Select("select * from product where id=#{productId}")
    Product findById(Long productId);

    @Select("select image_urls from product_details where id=#{id}")
    String findDetailsImageUrl(Long id);

    @Select("select * from product_sku where product_id=#{id}")
    List<ProductSku> findSkuSpecVlueMap(Long id);
}
